package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.List;

@TableName("t_user")
public class UserBean {
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private int id;
    @TableField("u_code")
    private String code;
    @TableField("u_pwd")
    private String pwd = "666";
    @TableField("u_name")
    private String name;
    @TableField(exist = false)
    private List<RoleBean> roleList;
    @TableField(exist = false)
    private List<GradeBean> gradeList;

    public UserBean() {
    }

    public UserBean(String code , String name) {
        this.code = code;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<RoleBean> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<RoleBean> roleList) {
        this.roleList = roleList;
    }

    public List<GradeBean> getGradeList() {
        return gradeList;
    }

    public void setGradeList(List<GradeBean> gradeList) {
        this.gradeList = gradeList;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", code='" + code + '\'' +
                ", pwd='" + pwd + '\'' +
                ", name='" + name + '\'' +
                ", roleList=" + roleList +
                ", gradeList=" + gradeList +
                "}\n";
    }
}
